﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework03
{
    /*    作业3:   将一个整形二维数组赋值为如下形式：
        1 2 3  4	
        2 4 6  8
        3 6 9  12
        4 8 12 16
         并在控制台显示（找到数据的规律！！！:a[i][j]=(i+1)*(j+1)）*/
    internal class Homework03
    {
        static void Main(string[] args)
        {
            //定义数组
            int[,] arr = new int[4, 4];
            //给数组赋值
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    arr[i, j] = (i+1)*(j+1);
                }
            }
            //打印数组
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for(int j = 0;j < arr.GetLength(1); j++)
                {
                    Console.Write($"{arr[i, j]}\t");
                }
                Console.WriteLine();
            }
        }
    }
}
